import { User } from 'src/user/entities/user.entity';
import {
  BaseEntity,
  Column,
  Entity,
  ManyToOne,
  PrimaryGeneratedColumn,
} from 'typeorm';

@Entity()
export class Address extends BaseEntity {
  @PrimaryGeneratedColumn()
  id: number;
  @Column()
  name: string;
  @Column()
  address: string;
  @Column()
  phone: string;

  @Column()
  sort: number;

  @Column()
  isShow: boolean;
  @Column()
  create_time: Date;
  @Column()
  update_time: Date;
  @Column({ nullable: true })
  delete_time: Date;

  @ManyToOne(() => User, (user) => user.address)
  user: User;
}
